@extends('layouts.userctl')
@section('content')
<style>
	.formpage {
		width: 60%;
		height: auto;
		margin: 10px auto;
	}

	.layui-form-label {
		width: 150px;
	}

	.layui-input-block {
		margin-left: 150px;
	}
</style>
<div class="formpage">
	<form class="layui-form" action="{{route('admin.demand.replay',['id'=>$de->id,'type'=>$type])}}" method="post"
		onkeypress="return event.keyCode != 13;">
		{{csrf_field()}}
		<div class="layui-form-item">
			<label class="layui-form-label">标题</label>
			<div class="layui-input-block">
				{{$de->title}}
			</div>
		</div>
		<div class="layui-form-item">
			<label class="layui-form-label">消息内容</label>
			<div class="layui-input-block">
				{{$de->content}}
			</div>
		</div>
		<div class="layui-form-item">
			<label class="layui-form-label">回复内容</label>
			<div class="layui-input-block">
				<input type="text" name="reply_content" required lay-verify="required" placeholder="请填写回复内容"
					   autocomplete="off" class="layui-input" value="{{$de->reply_content}}">
			</div>
		</div>
		<div class="layui-form-item">
			<div class="layui-input-block">
				<button class="layui-btn layui-btn-normal" lay-submit lay-filter="formDemo">确定</button>
				<a href="{{ url()->previous()}}" class="layui-btn layui-btn-primary" id="backpage">返  回</a>
			</div>
		</div>
	</form>
</div>
<script>
	//Demo
	layui.use('form', function() {
		var form = layui.form


	$('#backpage').click(function() {
			history.back(-1)
		})
		//监听提交
		form.on('submit(formDemo)', function(data) {
			var index = layer.load(0, { shade: false })
		})
	})
</script>

@endsection
